package ch10.test;

import java.sql.Connection;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

public class Apple {

	public static void main(String[] args) {
		List<String> list = new ArrayList();
		
		list.add("apple");
		list.add("grape");
		list.add("banana");
		list.add("pear");
		
		
		for(String str:list) {
			System.out.println(str);
		}
		String max = Collections.max(list);
		
		System.out.println(max);
		
		String min = Collections.min(list);
		System.out.println(min);
		
		Collections.sort(list);
		System.out.println(list);
		
	}

}
